//
//  ProvinceTableViewCell.m
//  I_LiaoNing
//
//  Created by 王心磊 on 15-4-9.
//  Copyright (c) 2015年 王心磊. All rights reserved.
//

#import "ProvinceTableViewCell.h"

@implementation ProvinceTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;

}

- (void)createSubViews
{
    self.myImgeView = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, 345, 170)];
    [self.contentView addSubview:self.myImgeView];
    [_myImgeView release];
    self.label = [[UILabel alloc]initWithFrame:CGRectMake(20, 150, 150, 30)];
    self.label.textColor = [UIColor whiteColor];
    self.label.font = [UIFont systemFontOfSize:20];
    [self.contentView addSubview:self.label];
    [_label release];
    
}

- (void)setModel:(ProvinceModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
        
    }
    NSURL *url = [NSURL URLWithString:model.photo];
    [self.myImgeView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"999.png"]];
    self.label.text = model.catename;
}












- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
